<?php

Class stock

{
	
	function get_stock_quote($symbol)
	
		{
		
		$url = sprintf("http://finance.yahoo.com/d/quotes.csv?s=%s&f=sl1d1t1c1ohgvjknrp6dr1j4ex" ,$symbol);
		
		$fp = fopen($url, "r");
		
		if(!fp)
			
		{
			
			echo "error : cannot recieve stock quote information";
			
		}
		
		else
			
		{
			
			$array = fgetcsv($fp , 4096 , ', ');
			
			fclose($fp);
			
			$this->symbol = $array[0];
			
			$this->last = $array[1];
			
			$this->date = $array[2];
			
			$this->time = $array[3];
			
			$this->change = $array[4];
			
			$this->open = $array[5];
			
			$this->high = $array[6];
			
			$this->low = $array[7];
			
			$this->volume = $array[8];
			
			$this->wl = $array[9];
			
			$this->wh = $array[10];
			
			$this->name = $array[11];
			
			$this->pe = $array[12];
			
			$this->pb = $array[13];
			
			$this->div = $array[14];
			
			$this->divdate = $array[15];
			
			$this->ebitda = $array[16];
			$this->eps = $array[17];
			$this->se = $array[18];
			
		}
		
		}
	
}
?>